<template>
  <div id="list-item">
    <listHeader></listHeader>
    <div class="body-inner_listItem">
      <div class="left-list_select">
        <ul>
          <li v-for="(item,i) in getGoodsTitle" :key="i" @click="goListGoodsInfo(i)">{{item}}</li>
        </ul>
      </div>
      <div class="right-list_goods">
          <router-view></router-view>
      </div>
    </div>
  </div>
</template>
<script>
import listHeader from "../children/Header.vue";
export default {
  data() {
    return {
      getGoodsTitle: [
        "为你推荐",
        "酒水饮料",
        "食品零食",
        "进口商品",
        "粮油调味",
        "家具护理",
        "清洁洗护",
        "出行必备",
        "文体医疗"
      ]
    };
  },
  methods: {
      goListGoodsInfo(i){
          //传参
          this.$router.push(`/listItem/listGoodsInfo/${i}`);
      }
  },
  components: {
    listHeader
  }
};
</script>
<style lang="less" scoped>
#list-item {
  padding-top: 1.3rem;
  margin-bottom: 1.2rem;
  .body-inner_listItem {
    width: 100%;
    display: flex;
    flex-direction: row;
    .left-list_select {
      width: 30%;
      ul {
        width: 100%;
        display: flex;
        flex-direction: column;
        li {
          width: 100%;
          height: 1.3rem;
          line-height: 1.3rem;
          text-align: center;
          background-color: #fff;
          border-bottom: 0.01rem solid #eee;
          color: #1c201f;
          font-size: 0.24rem;
        }
        li:hover{
            background-color: #f4f4f4;
            color: #e83632;
        }
      }
    }
    .right-list_goods {
      width: 70%;
    }
  }
}
</style>